import { AxiosRequestHeaders } from 'axios'
import HYRequest from './request'
import { TIME_OUT, BASE_URL } from './config'
const hyRequest = new HYRequest({
  baseURL: BASE_URL,
  timeout: TIME_OUT,
  headers: <AxiosRequestHeaders>{},
  interceptors: {
    requestSuccessFn: (config) => {
      console.log('单独请求成功拦截')
      return config
    },
    requestFailureFn: (err) => {
      console.log('单独请求失败拦截')

      return err
    },
    responseSuccessFn: (config) => {
      console.log('单独响应成功拦截')
      return config
    },
    responseFailureFn: (err) => {
      return err
    }
  }
})
export default hyRequest
